]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: Clear connectivity queue after portal login
authorMichael Catanzaro <mcatanzaro@redhat.com>
Mon, 28 Jul 2025 11:38:51 +0000 (13:38 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 13 Sep 2025 16:54:49 +0000 (18:54 +0200)
When full connectivity (or rather, non-portal connectivity) is achieved,
we can clear all active portal helpers.

Normally, the portal helper will signal that it is done, but it is
implemented in a racy manner. So here let's do a comprehensive big
hammer solution to guarantee the portal helper definitely gets
eventually closed even if we miss the race window in the portal helper.
(The race is: the portal helper checks connectivity status either
immediately or within a certain amount of time after a navigation policy
decision. This could theoretically be too soon, and if missed, it won't
be rescheduled.)

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3813>
(cherry picked from commit b8b690eb88db034b606e51cff64741557a72fc86)

js/ui/status/network.js

index c411afec0d6b92d74b512c7da8f6b4a35dbed27b..afa16dc2a1d224dcf6633c3b04723294059ff5fc 100644 (file)
@@ -2209,6 +2209,9 @@ class Indicator extends SystemIndicator {
             return;
         }
 
+        if (Main.sessionMode.isGreeter)
+            return;
+
         let isPortal = this._client.connectivity === NM.ConnectivityState.PORTAL;
         // For testing, allow interpreting any value != FULL as PORTAL, because
         // LIMITED (no upstream route after the default gateway) is easy to obtain
@@ -2217,12 +2220,14 @@ class Indicator extends SystemIndicator {
         // (but in general we should only prompt a portal if we know there is a portal)
         if (GLib.getenv('GNOME_SHELL_CONNECTIVITY_TEST') != null)
             isPortal ||= this._client.connectivity < NM.ConnectivityState.FULL;
-        if (!isPortal || Main.sessionMode.isGreeter)
-            return;
 
-        this._portalHandler.addConnection(
-            this._mainConnection.get_id(),
-            this._mainConnection.get_path());
+        if (isPortal) {
+            this._portalHandler.addConnection(
+                this._mainConnection.get_id(),
+                this._mainConnection.get_path());
+        } else {
+            this._portalHandler.clear();
+        }
     }
 
     _updateIcon() {